// 订单模型
const { Orders } = require('../../../models/order');

// 统一数据返回类
const { DataReturn } = require('../../../common/returnclass');

module.exports = async (req, res) => {
	let { _id } = req.fields;
	console.log(req.fields);
	
	// 更新地址信息 收货后改为待评价 3
	Orders.updateOne({_id}, {state:3})
	.then(()=>{
		DataReturn.getData(res,200,[],'收货成功')
	}).catch(()=>{
		DataReturn.getData(res,400,[],'收货失败')
	})


}